<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /**
         *  数组求和：
         *  var arr = [32,3,34,7,8,12,-9];
         * 
         */
        var arr = [32, 3, 34, 7, 8, 12, -9];

        var sum = 0;
        // sum += arr[0];
        // sum += arr[1];
        // sum += arr[2];
        // sum += arr[3];
        // sum += arr[4];
        // sum += arr[5];
        // sum += arr[6];

        for(var i = 0; i < arr.length;i++){
            sum += arr[i];
        }

        console.log(sum);

    </script>
</body>

</html>